﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace BooksOnline.Controllers
{
    public class BreadcrumbsController : Controller
    {
        //
        // GET: /Breadcrumbs/

        // Static is very bad
        private static Dictionary<string, string> breadcrumbs = new Dictionary<string, string>();

        public PartialViewResult Index()
        {
            ViewData.Model = breadcrumbs;

            return PartialView();
        }

        public void Add(string name, string url)
        {
            if(!breadcrumbs.ContainsKey(name))
                breadcrumbs.Add(name, url);
        }

    }
}
